//
//  XBNewModel.m
//  FindPreciousFrameWork
//
//  Created by TianZhen on 16/4/11.
//  Copyright © 2016年 MoreMoney. All rights reserved.
//

#import "XBNewModel.h"

@implementation XBNewModel
+ (instancetype)modelWithDict:(NSDictionary *)dict
{
    XBNewModel *model = [[self alloc] init];
    [model setValuesForKeysWithDictionary:dict];
    return model;
}

+ (NSArray *)models
{
    NSArray *array = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"new.plist" ofType:nil]];
    
    NSMutableArray *marr = [NSMutableArray array];
    for (NSDictionary *dict in array) {
        
        // 创建模型
        XBNewModel *model = [XBNewModel modelWithDict:dict];
        
        NSMutableArray *imagesURL = [NSMutableArray arrayWithCapacity:model.images.count];
        // 遍历模型的图片名称数组
        for (NSString *imageName in model.images) {
            
            [imagesURL addObject:imageName];
        }
        model.images = imagesURL;
        
        [marr addObject:model];
    }
    
    return marr;
}

@end
